using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class ObjectBulletBase : MonoBehaviour
{
    protected float _damage = 3f;
    protected Vector2 moveDir;
    protected Rigidbody2D rb;

    protected bool isDamage;
    protected virtual void Awake()
    {
        rb = GetComponent<Rigidbody2D>();
    }
    protected virtual void OnTriggerEnter2D(Collider2D other)
    {
        IDamagable damagable = other.GetComponent<IDamagable>();
        if (damagable == null)
            return;

        damagable.TakeDamage(_damage, moveDir);
        isDamage = true;
    }
}
